package com.yonder.gocommand.entity;

public enum OrderStatus {
	
	NEW("New"), ORDERED("Ordered"), DELIVERED("Delivered");
	private final String value;

	OrderStatus(String value) {
		this.value = value;
	}

	public static OrderStatus fromValue(String value) {
		if (value != null) {
			for (OrderStatus status : values()) {
				if (status.value.equalsIgnoreCase(value)) {
					return status;
				}
			}
		}
		return getDefault();
	}

	public String toValue() {
		return value;
	}

	public static OrderStatus getDefault() {
		return NEW;
	}
}
